<template>
  <!--
  @name: HyCustomComponent
  @data: 2024/7/2 9:32
  自定义组件
-->
  <div id="hy-custom-component">
<!--    <keep-alive>-->
      <component
        :is="props.component"
        :value="props.value"
        :form="form"
        :field="props.field"
      />
<!--    </keep-alive>-->
  </div>
</template>
<script setup lang="ts">
import type {HyCustomInterface} from "@/interface/HyFormInterface";

const props=defineProps<HyCustomInterface>();
console.log(20, props);
function callback(value:any) {
  console.log(16, value);
}

/** 双向绑定 */
const form = defineModel("form", {
  type: Object,
  default: () => {
  },
});
if (props.value){
  form.value[props.field]=props.value;
}


</script>
<style scoped>

</style>
